//    Copyright (C) Kherty.  All rights reserved.
namespace OpenLS.Spreadsheet.Parsing
{
    /// <summary>
    /// Summary description for SymbolCreator.
    /// </summary>
    class SymbolCreator : TokenCreator
    {
        public SymbolCreator(Symbol s)
        {
            Symbol = s;
            match = Symbol.Char();
        }
        public override int MatchSize()
        {
            return 1;
        }

        readonly Symbol Symbol;
        readonly char match;
        public override char[] FirstChars()
        {
            return new char[] { match };
        }
        public override Token Match(Lexer l)
        {
            if (l[l.Position] == match)
                return Symbol.Create();
            return null;
        }
    }
}
